package com.example.logindemo.demo.controller;

import com.example.logindemo.demo.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProfileController {

    @Autowired
    Person person;

    @Value("${person.name}")
    private String name;


    //根据指定的配置，返回不同类型子类
    @GetMapping("/profile")
    public String profileName(){
        return person.getClass().toString();
    }

    //根据指定的配置，返回不同类型子类
    @GetMapping("/person")
    public Person person(){
        return person;
    }
}
